/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package SPARQL;

import java.util.*;

/**
 *
 * @author riccardo
 */
public class Variable implements Subj, Pred, Obje{
    private String var;

    public Variable(String var) {
        this.var = var;
    }

    public void setVar(String var) {
        this.var = var;
    }

    public String getVar() {
        return var;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 41 * hash + Objects.hashCode(this.var);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Variable other = (Variable) obj;
        if (!Objects.equals(this.var, other.var)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return  "?"+var;
    }

    @Override
    public Object clone(){
        return new Variable(var);
    }
    
    
}
